package plugins

import "data-transfer/conf"

type (
	DbKind int
)

const (
	DbKindSource DbKind = iota
	DbKindTarget
	DbKindCanal
	DbKindInfoService

	DbNameSource      = "source"
	DbNameTarget      = "target"
	DbNameCanal       = "canal"
	DbNameInfoService = "infoservice"
)

type (
	// Plugin 为需要实现的任何数据库定义接口,现在只实现了mysql数据库
	Plugin interface {
		CreateDB(dbKind DbKind, cfg *conf.DbConfig) (DB, error)
	}

	// DB 为数据转换的常规操作定义API
	DB interface {
		TableCRUD
		PluginName() string
		Close() error
	}

	// TableCRUD 定义与数据库表交互的API
	TableCRUD interface {
		TargetStore
		SourceStore
		DataMonitor
		// InfoServiceStore

	}
)
